package biznussoft.metercor.fragments;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TableLayout;
import android.widget.TextView;
import biznussoft.metercor.R;
import biznussoft.metercor.listeners.GlobalListener;
import biznussoft.metercor.model.Bean_Class;
import biznussoft.metercor.model.ItemModel;
import biznussoft.metercor.model.JobCheckListModel;

public class ERTDumyFragment extends Fragment{

	private  Bean_Class model;
	public static ArrayList<ItemModel> ertDeviceList ;
	private ImageView  iv_expandcollapse;
	TableLayout ttlayout;
	private GlobalListener listener;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		return inflater.inflate(R.layout.data,container, false);
	}

	@Override
	public void onAttach(Activity activity) {
		// TODO Auto-generated method stub
		super.onAttach(activity);
		listener = (GlobalListener) getActivity();
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		ttlayout = (TableLayout) getView().findViewById(R.id.ttlayout);
		TextView header = (TextView) getView().findViewById(R.id.tvHeader);
		header.setText("ERT Device Installation ");
		iv_expandcollapse = (ImageView) getView().findViewById(R.id.iv_CollapseExpand);

	}

	public void showContacts(int position){
		model = AccountsFragment.list.get(position);
		ertDeviceList = AccountsFragment.subERTDeviceList.get(model.getId());
		ttlayout.setVisibility(View.GONE);
		iv_expandcollapse.setImageResource(R.drawable.navigation);
		iv_expandcollapse.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				listener.getSignature("ERTDeviceRecords");
				setHasOptionsMenu(false);
			}

		});
	}
}
